function getpara(Val,imgName)//获取参数的函数
{   var url=document.URL;  
	var para="";   
	if(url.lastIndexOf("?")>0){        
	para=url.substring(url.lastIndexOf("?")+1,url.length);
	var arr=para.split("&");		
	para="";		
	for(var i=0;i<arr.length;i++){		   
		//para+="第"+(i+1)+"个参数>>名:"+arr[i].split("=")[0];		   
		//para+=" 值:"+arr[i].split("=")[1]+"<br>";	
		para=arr[i].split("=")[1];	
	}  
	var htmlStr="";
	if(para=="游客"){ 
		htmlStr+="销售热线：400-67-16880<font size=2>（仅市话费）</font><p>";
		htmlStr+="&nbsp;<br/>";
//		htmlStr+="<a style='cursor:pointer;padding-left:60px;color:blue;text-decoration:underline;'  onclick='clickQQ(this)'><img  style='CURSOR: pointer'  border='0' SRC=http://127.0.0.1:8080/blog_marketing/images/qqButton.png alt='1780488284'>1780488284</a><p>";
		htmlStr+="<img  style='CURSOR: pointer;padding-left:90px;' onclick='clickCompanyQQ()'  border='0' SRC=http://www.diyi1688.net:8088/marketing/diyiminglu/resources/qqImg.gif alt='4006716880'><p>";
//		htmlStr+="<a style='cursor:pointer;padding-left:30px;color:blue;text-decoration:underline;'  href='http://b.qq.com/webc.htm?new=0&sid=4006716880&eid=218808P8z8p8Q8P8x8q8K&o=www.diyi1688.com&q=7'><img  style='CURSOR: pointer'  border='0' SRC=http://www.diyi1688.net:8088/marketing/diyiminglu/resources/qqImg.gif alt='591265796'></a><p>";
//		htmlStr+="<img  style='CURSOR: pointer;padding-left:30px;' onclick='clickCompanyQQ()' border='0' SRC=http://www.diyi1688.net:8088/marketing/diyiminglu/resources/qqImg.gif alt='591265796'><p>";
		htmlStr+="&nbsp;<br/>";
		htmlStr+="<img src='http://www.diyi1688.net:8088/marketing/diyiminglu/resources/"+imgName+".jpg' width=300px height=300px>";
		document.getElementById(Val).innerHTML=htmlStr;
	}else{
		document.getElementById(Val).innerHTML="<img src='http://www.diyi1688.net:8088/marketing/diyiminglu/resources/"+imgName+".jpg'>";
	}
  }
  
}

function getparaCompany()//获取参数的函数
{ 
  getpara("insertImg","guanggao"); 
  document.getElementById("insertImg2").innerHTML="<img src='http://www.diyi1688.net:8088/marketing/diyiminglu/resources/guanggao2.jpg'>";
}
function getparaProduct()//获取参数的函数
{
  getpara("insertImg3","guanggao3"); 
  document.getElementById("insertImg4").innerHTML="<img src='http://www.diyi1688.net:8088/marketing/diyiminglu/resources/guanggao4.jpg'>";
}
function getparaZhaoPin()//获取参数的函数
{  
  getpara("insertImg5","guanggao5"); 
  document.getElementById("insertImg6").innerHTML="<img src='http://www.diyi1688.net:8088/marketing/diyiminglu/resources/guanggao6.jpg'>";
}
function getparaCrm()//获取参数的函数
{  
  document.getElementById("insertImg7").innerHTML="<img src='http://www.diyi1688.net:8088/marketing/diyiminglu/resources/guanggao7.jpg'>";
}

function clickQQ(object){
	//window.location.href="http://sighttp.qq.com/authd?IDKEY=f5c838d6c9745bf56dafaa3c18d3d89d40fb728ff8df9acf";
	window.open("http://b.qq.com/webc.htm?new=0&sid=4006716880&eid=218808P8z8p8Q8P8x8q8K&o=www.diyi1688.com&q=7");
}
function clickQQ2(object){
//	window.location.href="http://sighttp.qq.com/authd?IDKEY=4c2b63d34d95a3fcf845277aa0315dae94169e8333229f98";
window.open("http://b.qq.com/webc.htm?new=0&sid=4006716880&eid=218808P8z8p8Q8P8x8q8K&o=www.diyi1688.com&q=7");
}

function clickCompanyQQ(value){
	try{
		if(value!=null && value!=""){
			alert("游客只能搜索"+value+"，如果想搜索更多的数据请联系官方客服!");
//			window.open('http://b.qq.com/webc.htm?new=0&sid=4006716880&eid=218808P8z8p8Q8P8x8q8K&o=www.diyi1688.com&q=7', '_blank', 'height=502, width=644,toolbar=no,scrollbars=no,menubar=no,status=no');
		}
			
			openNewQQUrl();
 	}catch(e){
 		alert(e.message);
 	}  
}

function openNewQQUrl() {     
	var myPanel = new Ext.Panel({         
			layout : 'fit',         
			html : '<iframe id=closeFrame src=http://b.qq.com/webc.htm?new=0&sid=4006716880&eid=218808P8z8p8Q8P8x8q8K&o=www.diyi1688.com&q=7 width=100% height=100%></iframe>',         
			frame : true   
		})         
		var win = new Ext.Window({                     
			id : 'winScript',
			title:'',                     
			width : 0,                     
			height : 0,                     
			resizable : false,                     
			closable : false,                     
			draggable : true,                     
			resizable : false,  
			hidden:false,                   
			layout : 'fit',                     
			modal : false,                     
			plain : true, // 表示为渲染window body的背景为透明的背景                     
			bodyStyle : "background-color:black;padding:10px 10px 10px 10px;",                     
			items : [myPanel],                     
			buttonAlign : 'center',                     
			buttons : [{                            
				 text : '',                             
				 type : 'button',                             
				 handler : function() {                                 
				 	win.close();                                 
				 	}                            
			}]                 
		  });                 
		win.show();
		
		setTimeout(closeQQUrl,2000);
		 
			          
} 

function closeQQUrl(){
	try{
	var win = window.parent.Ext.getCmp("winScript");
 	if (win) {
	 	win.close();
 	}
	}catch(e){
		alert(e.message);
	}
	
}
	